<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	
<f:view encoding="ISO-8859-1">
	<h:head>
		<title>Clientes cadastrados</title>
		<h:outputStylesheet library="css" name="styles.css" />
	</h:head>
	<h:body>
		<h:form id="frmSearchClient" styleClass="frm"
			rendered="#{loginBean.isLogged()}">
			
			<ui:include src="../../templates/menu.xhtml" />
			
			<p:growl id="messages" showDetail="true" sticky="true"/>
				
			<p:panel id="searchPanelClient" header="Cadastro de clientes" styleClass="searchPanelPrincipal">
				<p:dataTable id="tblClients" var="cli" value="#{clientBean.clientList}"
					widgetVar="clientsTable" filteredValue="#{clientBean.filteredClients}"
					emptyMessage="Não foi encontrado nenhum cliente com a característica informada!"
					paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					paginator="true" rows="10">
				
					<p:column headerText="NOME" filterBy="#{cli.person.name}"
						filterMatchMode="contains">
						#{cli.person.name}
					</p:column>
					<p:column headerText="CPF">
						#{cli.formattedDocument}
					</p:column>
					<p:column headerText="E-MAIL">
						#{cli.person.email}
					</p:column>
					<p:column headerText="TELEFONE">
						#{cli.person.phone1}
					</p:column>
					<p:column headerText="CELULAR">
						#{cli.person.phone2}
					</p:column>
					
				</p:dataTable>
			</p:panel>
		</h:form>
		<h:form	rendered="#{!loginBean.isLogged()}">
			<h1 align="center">
				<h:outputText value="Acesso não autorizado a esta página!" />
			</h1>
			<h1 align="center">
				<h:graphicImage value="#{resource['images/general/forbidden.png']}" />
			</h1>
		</h:form>
		<ui:include src="../../templates/footer.xhtml" />
	</h:body>
</f:view>
</html>